

export function loadImg(el) {
    var preLoadNum = 1
    var preLoadImgList = []
    return new Promise(function (resolve, reject) {        //做一些异步操作
        for (var i = 0; i < imglist.length; i++) {
            preLoadImgList[i] = new Image();
            preLoadImgList[i].src = imglist[i];
            preLoadImgList[i].onload = function () {
                preLoadNum++;
                el.load_percent = Math.floor(preLoadNum / imglist.length * 100);
                if (preLoadNum >= imglist.length) {
                    resolve()
                    return
                }

            }
        }
    })
}